package com.haixee.parkdemo.common.response;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.http.HttpStatus;

import java.util.Map;

/**
 * 数据返回 结构
 *
 * @author GUIFENG GUO
 * 2020/3/22 7:44
 */
@Data
public class ResResult<T> {

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 提示信息
     */
    private String msg;

    /**
     * 具体内容
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private T data;

    /**
     * 请求状态码，不会返回给客户端
     */
    @JsonIgnore
    private HttpStatus status;

    /**
     * 列表请求，总数
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long total;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Map<String, Object> additionalData;
}
